import React, { useEffect } from 'react';
import { history } from 'umi';
import * as echarts from 'echarts';
import './index.css';

// 领用人员分布
export default function index() {
  const init = () => {
    var myChart = echarts.init(document.getElementById('ly'));
    myChart.setOption({
      tooltip: {
        trigger: 'item',
      },
      legend: {
        orient: 'vertical',
        left: 'left',
      },
      series: [
        {
          name: '客户数量',
          type: 'pie',
          data: [
            { value: 5, name: '宋洁然' },
            { value: 30, name: '钟凯' },
            { value: 5, name: '张晓' },
            { value: 60, name: '张研' },
          ],
        },
      ],
    });
  };
  useEffect(() => {
    init();
  }, []);
  return (
    <div className="customer" style={{ backgroundColor: 'white' }}>
      <div className="customertitle">
        <span>领用人员分布</span>
        <img
          src=""
          alt=""
          onClick={() => {
            history.push('/home/collecting');
          }}
        />
      </div>
      <div id="ly" style={{ width: '400px', height: '400px' }}></div>
    </div>
  );
}
